/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package elementsDefense.gui;

import com.jme3.asset.AssetManager;
import com.jme3.font.BitmapFont;
import com.jme3.font.BitmapText;
import com.jme3.scene.Node;

/**
 *
 * @author Ricardo
 */
public class Label {
    
    String text="";
    BitmapText bitmapText;
    static BitmapFont guiFont;

    public Label(int x, int y, int width, int height, AssetManager assetManager, Node guiNode) {
        if(guiFont==null) guiFont = assetManager.loadFont("Interface/Fonts/ArialBlack.fnt");
        bitmapText = new BitmapText(guiFont, false);
        bitmapText.setSize(guiFont.getCharSet().getRenderedSize()+1);
        bitmapText.setLocalTranslation(x, y, 0);
        guiNode.attachChild(bitmapText);
    }
    
    public void setText(String text){
        bitmapText.setText(text);
    }
    
}
